package 我的Java学习_算法基础.day_05;

import java.util.Arrays;

public class _084_字符串匹配之后缀数组_上 {

    public static Suff[] getSa1(String src){
        int strLength = src.length();
        Suff[] suffixArray = new Suff[strLength];
        for (int i = 0; i < strLength; i++) {
            String suffI = src.substring(i);//截取后缀
            suffixArray[i] = new Suff(suffI,i);
        }
        Arrays.sort(suffixArray);//自定义比较规则
        return suffixArray;
    }


}
